#ifndef __SIPCLN_TRANSACTION_HPP__
#define __SIPCLN_TRANSACTION_HPP__

//#include "resip/stack/ApplicationMessage.hxx"
#include "WTResipDll/SipWTResipDllItf.hpp"


namespace wtsip{

class CSipClnTransaction;
class CSipUserAgent;
class CSipDialogBase;
    

class CSipClnTransaction: public ISipClnTransaction
{
public:
    CSipClnTransaction(CSipMessage& request, CSipUserAgent& ua);

    virtual ~CSipClnTransaction();

    virtual bool processIncoming(CapSipMessage msg);

    virtual bool cancel();

    virtual bool send(CapSipMessage msg);

    virtual bool registerCallback(ISipClnTransactionCallback* callback);

    virtual bool unregisterCallback(ISipClnTransactionCallback* callback);

    virtual bool bindDialog(CSipDialogBase* dialog);

    virtual ISipClnTransaction::EClnTranState getState() const;

    //virtual SipMessage& getRequest();

    virtual const resip::Data& getTid() const;

    virtual CSipDialogBase* getBindDlg() const;

    virtual bool hasCallback() const;

protected:

    virtual bool setState(EClnTranState state);

protected:

    EClnTranState m_State;

    CSipUserAgent& m_ua;

    //resip::SipMessage m_request;

    CSipDialogBase* m_bindDialog;

    resip::Data m_tid;

    resip::MethodTypes m_mth;

    int m_Seq;

    ISipClnTransactionCallback* m_callback;
};


}//namespace

#endif

